fn main() {
    let condition = true;

    let number = if condition {
        5
    } else {
        6 /*"six"*/
    };

    println!("The value of number is: {number}");

    let mut count = 0;
    let result = loop {
        count += 1;
        if count == 10 {
            break count * 2;
        }
    };
    println!("The result is {result}");

    count = 0;
    'counting_up: loop {
        println!("count={count}");

        let mut remaining = 10;

        loop {
            println!("remaining = {remaining}");
            if remaining == 9 {
                break;
            }
            if count == 2 {
                break 'counting_up;
            }
            remaining -= 1;
        }

        count += 1;
    }

    println!("End count = {count}");

    let mut number = 3;
    while number != 0 {
        println!("number={number}");
        number -= 1;
    }
    println!("LIFTOFF!!!");

    let a = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100];
    let mut index = 0;
    while index < a.len() {
        println!("the value is {}", a[index]);

        index += 1;
    }

    for element in a {
        println!("the value is {element}");
    }

    for number in (1..4).rev() {
        println!("{number}!");
    }
}
